#pragma once
#include <QStyledItemDelegate>
#include <QVector>

class KeySearchWidget;
class DefaultItemDelegate : public QStyledItemDelegate {
 public:
  DefaultItemDelegate(KeySearchWidget *w, int itemHeight, int fontSize = 10);

  // painting
  void paint(QPainter *painter, const QStyleOptionViewItem &option,
             const QModelIndex &index) const override;
  QSize sizeHint(const QStyleOptionViewItem &option,
                 const QModelIndex &index) const override;

  void setColumnWidth(const QVector<int> &widths) { m_widths = widths; }

 private:
  KeySearchWidget *m_host = nullptr;
  QVector<int> m_widths;
  int m_itemHeight = 0;
  int m_fontSize = 10;
};
